<div id="Specifying-a-repository"></div>
<div class="header">
<p>
Next: [[cvs: How data is stored in the repository#How data is stored in the repository|Repository storage]], Up: [[cvs: The Repository#The Repository|Repository]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>

----

<div id="Telling-CVS-where-your-repository-is"></div>
=== Telling CVS where your repository is ===

There are several ways to tell <small>CVS</small>
where to find the repository.  You can name the
repository on the command line explicitly, with the
<code>-d</code> (for &quot;directory&quot;) option:

<div class="example" style="margin-left: 3.2em">
 cvs -d /usr/local/cvsroot checkout yoyodyne/tc
</div>

<div id="index-_002eprofile_002c-setting-CVSROOT-in"></div>
<div id="index-_002ecshrc_002c-setting-CVSROOT-in"></div>
<div id="index-_002etcshrc_002c-setting-CVSROOT-in"></div>
<div id="index-_002ebashrc_002c-setting-CVSROOT-in"></div>
<div id="index-CVSROOT_002c-environment-variable"></div>
Or you can set the <code>$CVSROOT</code> environment
variable to an absolute path to the root of the
repository, &lsquo;<tt>/usr/local/cvsroot</tt>&rsquo; in this example.
To set <code>$CVSROOT</code>, <code>csh</code> and <code>tcsh</code>
users should have this line in their &lsquo;<tt>.cshrc</tt>&rsquo; or
&lsquo;<tt>.tcshrc</tt>&rsquo; files:

<div class="example" style="margin-left: 3.2em">
 setenv CVSROOT /usr/local/cvsroot
</div>

<code>sh</code> and <code>bash</code> users should instead have these lines in their
&lsquo;<tt>.profile</tt>&rsquo; or &lsquo;<tt>.bashrc</tt>&rsquo;:

<div class="example" style="margin-left: 3.2em">
 CVSROOT=/usr/local/cvsroot
 export CVSROOT
</div>

<div id="index-Root-file_002c-in-CVS-directory"></div>
<div id="index-CVS_002fRoot-file"></div>
A repository specified with <code>-d</code> will
override the <code>$CVSROOT</code> environment variable.
Once you&rsquo;ve checked a working copy out from the
repository, it will remember where its repository is
(the information is recorded in the
&lsquo;<tt>CVS/Root</tt>&rsquo; file in the working copy).

The <code>-d</code> option and the &lsquo;<tt>CVS/Root</tt>&rsquo; file both
override the <code>$CVSROOT</code> environment variable.  If
<code>-d</code> option differs from &lsquo;<tt>CVS/Root</tt>&rsquo;, the
former is used.  Of course, for proper operation they
should be two ways of referring to the same repository.

This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
